<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<h:panelGrid id="userRoleInputPanel" columns="1" style="width:100%">
		<p:commandButton oncomplete="roleDlg.show()" ajax="true"
			update=":dialogForm,:headerForm" icon="add"
			actionListener="#{roleController.init}" value="Add" title="Add roles"
			style="float:left"></p:commandButton>
		<p:dataTable var="role" value="#{userModel.current.roles}" rows="20">
			<f:facet name="header">List of Roles</f:facet>
			<p:column style="width:20px">
				<f:facet name="header">
					<p:commandButton icon="delete" ajax="true" update=":detailForm"
						style="float:right"
						actionListener="#{userController.removeSelectedRolesFromCurrent}"></p:commandButton>
				</f:facet>
				<p:selectBooleanCheckbox value="#{role.selected}"></p:selectBooleanCheckbox>
			</p:column>
			<p:column headerText="id">
				<h:outputText value="#{role.id}" />
			</p:column>
			<p:column headerText="Name" sortBy="#{role.name}">
				<h:outputText value="#{role.name}" />
			</p:column>

			<p:column headerText="Description">
				<h:outputText value="#{role.description}" />
			</p:column>
		</p:dataTable>
	</h:panelGrid>
</ui:composition>

</html>